package network

import (
	"fmt"
	"github.com/spf13/cobra"
)

func GetNetworkRecoveryCmd() *cobra.Command {
	return &cobra.Command{
		Use:   "recovery",
		Short: "recovery all networks",
		Long:  `recovery all networks your have created`,
		Args:  cobra.MinimumNArgs(0),
		Run:   networkRecovery,
	}
}

func networkRecovery(cmd *cobra.Command, args []string) {
	if len(args) > 0 {
		_ = cmd.Help()
	}

	err := Init()
	if err != nil {
		fmt.Println("failed to recovery network with error : ", err.Error())
		return
	}
}
